<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Quick Start</title>
  <script src="/js/spritejs.js"></script>
  <style>
    html,body {
      margin: 0;
      padding: 0;
      background: #201e1e;
      height: 100%;
      width: 100%;
      max-width: 800px;
    }

    #stage {
      display: inline-block;
      width: 100%;
      height: 0;
      padding-bottom: 100%;
      background: #201e1e;
    }  
  </style>
</head>
<body>
  <div id="stage"></div>
  <script>
  const {Scene, Sprite, Label, Group} = spritejs;
  const container = document.getElementById('stage');
  const scene = new Scene({
    container,
    width: 1200,
    height: 1200,
    displayRatio: 2,
  });

  const fglayer = scene.layer('fglayer');
  fglayer.canvas.style.backgroundColor = '#3f097a';

  const group = new Group();
  group.attr({
    pos: [600, 540],
  });

  fglayer.append(group);

  const text1 = new Label('Hello World !');

  text1.attr({
    anchor: [0.5, 0.5],
    font: 'bold 48px Arial',
    fillColor: '#ffdc45',
  });

  const text2 = new Label('SpriteJS.org');
  text2.attr({
    anchor: [0.5, 0.5],
    y: 60,
    font: 'bold 48px Arial',
    fillColor: '#ffdc45',
  });

  group.animate([
    {scale: 1.5, rotate: -30},
    {scale: 1, rotate: 0},
    {scale: 1.5, rotate: 30},
  ], {
    duration: 3000,
    iterations: Infinity,
    direction: 'alternate',
  });

  group.append(text1, text2);
  </script>
</body>
</html>